<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Nova Cidade</title>
</h:head>
<h:body>
	<h:form id="incluirCidade">

		<table width="100%">
			<tr>
				<td><ui:include src="menuPrincipal.xhtml" />
				</td>
			</tr>
		</table>
		<table width="40%" align="center">
			<tr>
				<td><p:panel header="Nova Cidade">
						<h:panelGrid columns="2">

							<h:outputText value="Nome da cidade: " />
							<p:inputText value="#{cidadeMB.cidade.nome}" maxlength="20" size="30"
								title="Nome do cidade" />

							<h:outputText value="País: " />
							<h:selectOneMenu id="selectPais"
								value="#{cidadeMB.paisSelected.id}"
								layout="pageDirection">
								<f:selectItems value="#{cidadeMB.estado.pais.nome}" />
								<f:ajax event="click" render="estadoSelected" />
							</h:selectOneMenu>

							<h:outputText value="Estado: " />
							<h:selectOneMenu id="estadoSelected"
								value="#{cidadeMB.estadoSelected.id}"
								layout="pageDirection">
								<f:selectItems value="#{cidadeMB.estado.nome}" />
							</h:selectOneMenu>
							
						</h:panelGrid>
					</p:panel></td>
			</tr>
		</table>
	</h:form>
</h:body>
</html>
